package com.ifinc.common.service;

import com.ifinc.common.db.BaseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * User: luotao
 * Date: 12-5-19
 * Time: 22:08
 */

public class DBJdbcService {
    public BaseDao baseDao;

    @Autowired
    public void setBaseDao(BaseDao baseDao) {
        this.baseDao = baseDao;
    }

    public int queryForInt(String sql, Object... values) {
        return baseDao.getJdbcTemplate().queryForInt(sql, values);
    }

    public int update(String sql, Object... values) {
        return baseDao.update(sql, values);
    }

    public List<Map<String, Object>> queryForList(String sql, Object... values) {
        return baseDao.getJdbcTemplate().queryForList(sql, values);
    }
}
